<?php

/****************************************************************************************\
 **   @name		EXP Templates 1.0                                               **
 **   @package          Joomla 1.6/1.7/2.5                                              **
 **   @author		EXP TEAM::Alexey Kurguz (Grusha)                                **
 **   @copyright	Copyright (C) 2005 - 2011  EXP TEAM::Alexey Kurguz (Grusha)     **
 **   @link             http://www.feellove.eu                                          **
 **   @license		Commercial License                                              **
 \****************************************************************************************/


defined('JPATH_BASE') or die;

jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

class JFormFieldExpCssFile extends JFormFieldList {

    protected $type = 'ExpCssFile';

    public function getInput($data=0) {
        $inputfolder = (string) JPATH_ROOT . DS .$this->element['tmp_patch'];
        $allcss = JFolder::files($inputfolder, '.css$', false, false);
        foreach ($allcss as $val) {
                $options[] = JHTML::_('select.option', $val, $val);
            }
        $attr = '';
        $return = JHtml::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value);

        return $return;
    }

}
